var mongodb = require('./config.js');
var Schema = mongodb.Schema;
var AppSchema = new Schema({
        author:String,
        authorId:String,
        time: { type: Date, default: Date.now },
        icon:String,
        topic:String,
        tag:String,
        likeNum:{ type: Number, default:0 },
        markNum:{ type: Number, default:0 },
		markList:[
			{
			 userName:String,
			 userId:String,
			 markTime: { type: Date, default: Date.now },
			 userIcon:String,
			 markContent:String,
			 like:{ type: Number, default:0 },
			 liked:[{ type: String, default:'' }],
			}
		]
});
var userSchema = new Schema({
    user:String,
    password:String,
    icon:{ type: String, default:'http://git.oschina.net/uploads/99/974299_baisoft_org.png?1483500414' },
});
var RnAppInfo = mongodb.model("RnAppInfo", AppSchema);
var RnUserInfo = mongodb.model("RnUserInfo", userSchema);

exports.RnAppInfo = RnAppInfo;
exports.RnUserInfo = RnUserInfo;